Skip to content

docs: improve document for setChecked(), setSelected() and setValue() #728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 18, 2018

Conversation

38elements
Copy link
Contributor

@38elements 38elements commented Jun 16, 2018

This is related to #700 and #729.

@38elements 38elements mentioned this pull request Jun 16, 2018

Sets the value of a radio or checkbox `<input>`.
Sets the value to an input element of type checkbox or an input element of type radio.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change this to mention the v-model:

Sets checked value for input element of type checkbox or radio and updates v-model bound data.

Sets the value of a radio or checkbox `<input>`.
Sets the value to an input element of type checkbox or an input element of type radio.

When you try to set the value to state via `v-model` by `radioInput.element.checked = true; radioInput.trigger('input')`, `v-model` is not triggered. `v-model` is triggered by `change` event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add this to a notes sections after the arguments and example, I don't think most users need this info


- **Arguments:**
- `{Boolean} selected`
When you try to set the value to state via `v-model` by `option.element.selected = true; parentSelect.trigger('input')`, `v-model` is not triggered. `v-model` is triggered by `change` event.
Copy link
Member

@eddyerburgh eddyerburgh Jun 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also move this to a - **Notes:** section

Sets the value of a text `<input>`.
Sets the value to an input element of type text.

`textInput.setValue(value)` is an alias of the following code.
Copy link
Member

@eddyerburgh eddyerburgh Jun 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also move this to notes

@@ -1,6 +1,13 @@
## setValue(value)

Sets the value of a text `<input>`.
Sets the value to an input element of type text.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sets the value to an input element of type text.

Sets value of a text-control input element and updates v-model bound data


Sets a specified `<option>` as selected in a `<select>`.
Selects a option element.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selects a option element.

Selects a option element and updates v-model bound data.

@38elements
Copy link
Contributor Author

Thank you for pointing out.
I changed them.

Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job! Just one small comment, a -> an.


- **Arguments:**
- `{Boolean} selected`
Selects a option element and updates `v-model` bound data.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selects an option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Copy link
Member

@eddyerburgh eddyerburgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@eddyerburgh eddyerburgh merged commit c78ed4e into vuejs:dev Jun 18, 2018
@38elements 38elements deleted the patch-9 branch June 19, 2018 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants